package sjtu.ist.warehouse4ws.service;

import java.util.List;

import sjtu.ist.warehouse4ws.dao.CompanyDaoHibernate;
import sjtu.ist.warehouse4ws.model.Company;

public class CompanyServiceImpl implements CompanyService{

	private CompanyDaoHibernate companyDao;
	
	public void setCompanyDao(CompanyDaoHibernate companyDao){
		this.companyDao = companyDao;
	}
	@Override
	public Company get(Integer id) {
		return companyDao.get(id);
	}

	@Override
	public Integer save(Company company) {
		return (Integer)companyDao.save(company);
	}

	@Override
	public void update(Company company) {
		companyDao.update(company);
	}

	@Override
	public void delete(Integer id) {
		companyDao.delete(id);
	}

	@Override
	public void delete(Company company) {
		companyDao.delete(company);
	}

	@Override
	public List<Company> findByName(String name) {
		return companyDao.findByName(name);
	}
	@Override
	public List<Company> getAllCompanies() {
		// TODO Auto-generated method stub
		return companyDao.getAllCompanies();
	}

}
